<template>
  <el-form :model="replaceForm" class="el-row" label-width="120px">
    <el-form-item label="数据范围：" class=" el-col-20">
      <district-select v-model="replaceForm.dataRange" />
    </el-form-item>
    <el-form-item label="存量数据来源：" class=" el-col-20">
      <el-input></el-input>
    </el-form-item>
    <el-form-item label="替换为：" class=" el-col-20">
      <el-input></el-input>
    </el-form-item>
    <el-form-item label-width="0" class="el-col-24" style="text-align: center;">
      <el-button type="primary" @click="submit">确定</el-button>
      <el-button type="error" @click="closeDialog"> 取消</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
import districtSelect from '../districtSelect.vue'

export default {
  data () {
    return {
      replaceForm: {
        dataRange: []
      }
    }
  },
  methods: {
    submit () {
      const loading = this.$loading({
        lock: true,
        text: 'Loading',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      });
      setTimeout(() => {
        loading.close()
        this.$message.success('替换成功')
      }, 2000);
      this.closeDialog()
    },
    closeDialog () {
      this.$emit('closeDialog')
    },
  },
  components: {
    districtSelect
  }
}
</script>

<style lang="less">
</style>